using System.Collections.Generic;
namespace Framework.DataTable
{
    public abstract class DataTableManager
    {
        public int Count { get { return _list == null ? 0 : _list.Count; } }
        private List<IDataTableLoader> _list;
        public DataTableManager()
        {

        }
        protected T add<T>(T loader) where T : IDataTableLoader
        {
            if (_list == null)
            {
                _list = new List<IDataTableLoader>();
            }
            _list.Add(loader);
            return (T)loader;
        }
        public IDataTableLoader GetLoader(int index)
        {
            if (_list == null) return null;
            if (index < 0 || index >= _list.Count) return null;
            return _list[index];
        }
    }
}